package com.mo.demo;

import android.annotation.SuppressLint;
import android.app.Application;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothGatt;
import android.content.Context;

import com.home.adapter.BluetoothDataModel;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Set;

/* loaded from: classes.dex */
public class MyApp extends Application {
    public static MyApp app = null;
    private static Context applicationContext = null;
    private static boolean auto = false;
    private static boolean canConnect = true;
    public static final String tag = "ble";
    private ArrayList<BluetoothDevice> bleDevices;
    private HashMap<String, Boolean> hashMapConnect;
    private HashMap<String, BluetoothGatt> hashMapGatt;
    private boolean legal;
    private ArrayList<BluetoothDataModel> manmualBleDevices;
    private int safetyLevel;
    private String sceneBean;
    private Set<BluetoothDevice> tempDevices;
    private String wifiSSID;

    @Override // android.app.Application
    public void onCreate() {
        super.onCreate();
        Context applicationContext2 = getApplicationContext();
        applicationContext = applicationContext2;
        this.bleDevices = new ArrayList<>();
        this.hashMapConnect = new HashMap<>();
        this.hashMapGatt = new HashMap<>();
        this.manmualBleDevices = new ArrayList<>();
        app = this;
    }

    public static Context getInstance() {
        return applicationContext;
    }

    public boolean isAuto() {
        return auto;
    }

    public boolean isCanConnect() {
        return canConnect;
    }

    public void setAuto(boolean z) {
        auto = z;
    }

    public void setCanConnect(boolean z) {
        canConnect = z;
    }

    public static MyApp getApp() {
        return app;
    }

    public void setSceneBean(String str) {
        this.sceneBean = str;
    }

    public String getSceneBean() {
        return this.sceneBean;
    }

    public ArrayList<BluetoothDevice> getBleDevices() {
        return this.bleDevices;
    }

    public HashMap<String, Boolean> getHashMapConnect() {
        return this.hashMapConnect;
    }

    public HashMap<String, BluetoothGatt> getBleGattMap() {
        return this.hashMapGatt;
    }

    public ArrayList<BluetoothDataModel> getManmualBleDevices() {
        return this.manmualBleDevices;
    }

    @SuppressLint("MissingPermission")
    public void clearBleGatMap(String str) {
        BluetoothGatt bluetoothGatt;
        if (this.hashMapGatt.size() <= 0 || str == null || (bluetoothGatt = this.hashMapGatt.get(str)) == null) {
            return;
        }
        bluetoothGatt.disconnect();
    }

    public Set<BluetoothDevice> getTempDevices() {
        return this.tempDevices;
    }

    public void setTempDevices(Set<BluetoothDevice> set) {
        this.tempDevices = set;
    }

    public void setSafetyLevel(int i) {
        this.safetyLevel = i;
    }

    public int getSafetyLevel() {
        return this.safetyLevel;
    }

    public void setWifiSSID(String str) {
        this.wifiSSID = str;
    }

    public String getWifiSSID() {
        return this.wifiSSID;
    }

    public void setLegal(boolean z) {
        this.legal = z;
    }

    public boolean getLegal() {
        return this.legal;
    }
}